package mygang.schedule;

import mygang.singleton.Settings;
import org.apache.log4j.Logger;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 *
 * @author Volodymyr Lavrynovych <volodya.lavrynovych@gmail.com>
 * date: 13/09/2012
 */
@Configuration
@EnableScheduling
public class SystemScheduler extends AbstractScheduler {
    
    private static final Logger log = Logger.getLogger(SystemScheduler.class.toString());
    
    public SystemScheduler(){}
    
    @Scheduled(fixedDelay=MINUTE*5) // every 5 min
    private void refreshSettings(){
        Settings.getInstance().refresh();
        log.debug("Settings are refreshed...");
    }

}